|
|
I've created a test image with UVPOV using Photon Mapping. It is an
illustration of a standard class-room experiment showing refraction and
reflection. I wanted to see whether Photon mapping actually could do this,
and the results were quite surprising.
The only problem is that the rays are a bit splotchy and I cannot find good
settings for them.
It was amazing to see that the photons are refracted through the prism and
reflected on the inside, creating a zig-zag pattern as one would expect from
the real world. Rendering time was about 8 mins; 6 mins mapping photons. :/
But I am not quite happy yet. There seems to be some strange phenomena, for
example the forst refracted the stripe suddenly ends!
Any comments welcome!
Simen.
------
// beginnig of source for prism1.jpg
#include "colors.inc"
// settings for photon gathering; as in example in the docs. Lower
// phd gives better results and longer tracing time.
#declare phd=0.35;
global_settings{
photons{
gather 20, 100
radius 0.1*phd, 2, 0.1*phd
//autostop 0
jitter .01
expand_thresholds 0.2, 40
}
max_trace_level 20
}
// an ambient light source
light_source { <-50, 50, -50> color White*0.45 }
// camera - placed on the z-axis then rotated
camera {
location -z*30
direction z
up y
right 4/3*x
angle 40
look_at 0
rotate <47, 30, 0>
}
// some settings:
#declare w = 0.41; // witdh of constraining container
#declare l = 30; // length of containter - bigger gives narrower spreading angle on
the ray
#declare stre = 10; // strenth of light - do not increase this if l is increased -
automatic adjustment here
#declare h = 10; // height of container. Just a formality
union {
light_source {
<0, 2, 0> color White*l*stre
}
difference {
box { <-(w/2+0.5), 0, -(w/2+0.5)>, <l, h+1, w/2+0.5> }
box { <-(w/2), -1, -(w/2)>, <l+1, h+2,
w/2> }
pigment {
color Green
}
}
translate x*-l
rotate y*70
translate <-7, 0, 15>
}
// the prism
box {
-1, 1
scale <5, 1, 3>
translate y*1
pigment {
color rgbf <1, 1, 1, 0.78>
}
finish {
phong 1
phong_size 150
reflection 0.22
ambient 0.4
diffuse 0.6
}
interior {
ior 1.44
}
photons {
separation 0.02*phd
refraction on
reflection on
//ignore_photons
}
}
// graph paper
plane {
y, 0
texture {
pigment {
gradient x
color_map {
[0.0, 0.021 color Blue color Blue]
[0.021, 1.0 color White color White]
}
}
}
texture {
pigment {
gradient z
color_map {
[0.0, 0.021 color Blue color Blue]
[0.021, 1.0 color Clear color Clear]
}
}
finish {
ambient 0.01
diffuse 0.99
}
}
}
// end of source.
Post a reply to this message
Attachments:
Download 'prism1.jpg' (52 KB)
Preview of image 'prism1.jpg'
|
|